<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>debug</title>
    <style>
        a, button {
            margin: 10px;
        }
    </style>
    <script type="application/javascript">
        let count = 0;
        (function () {
            ipc.on("on-name", function (str, bool, int, float) {
                let msg = document.getElementById("msg")
                let data = "str: " + str + " bool: " + bool + " int: " + int + " float: " + float + " " + Math.random()
                msg.innerHTML = count + " : " + data
                return data
            });
        })()

        function ipcEmit() {
            ipc.emit("emit-name", ["杨红岩", "age", Math.random() + count]);
            count++
        }

        let set = null;

        function autoIpcEmit() {
            if (set == null) {
                set = setInterval(function () {
                    ipc.emit("emit-name", ["杨红岩", "age", Math.random() + count]);
                    count++
                }, 0)
            } else {
                clearInterval(set)
                set = null
            }
        }

        function cookieVisited() {
            ipc.emit("cookieVisited")
        }

        function cookieDelete() {
            ipc.emit("cookieDelete")
        }

        function setCookie() {
            ipc.emit("setCookie")
        }

        function showDevtools() {
            ipc.emit("showDevtools")
        }

        function domVisitor() {
            ipc.emit("domVisitor")
        }

        function executeDevToolsMethod() {
            ipc.emit("executeDevToolsMethod")
        }

        function executeJavaScript() {
            ipc.emit("executeJavaScript")
        }

        function webkit() {
            let msg = document.getElementById("msg")
            msg.innerText = test.myparam
            test.myparam = new Date().getTime().toString()
        }

    </script>
</head>
<body>
<p>
<h1>debug</h1>
</p>
<p>
    <a href="index.html">index.html</a>
    <a href="https://www.baidu.com">baidu</a>
    <a href="fs://energy">scheme fs://energy</a>
</p>
<p>
    <button onclick="ipcEmit()">emit</button>
    <button onclick="autoIpcEmit()">auto emit</button>
</p>
<p>
    <button onclick="cookieVisited()">cookie visited</button>
    <button onclick="cookieDelete()">cookie delete</button>
    <button onclick="setCookie()">cookie set</button>
    <button onclick="showDevtools()">show devtools</button>
    <button onclick="domVisitor()">dom visitor</button>
    <button onclick="executeDevToolsMethod()">execute DevTools Method</button>
    <button onclick="executeJavaScript()">execute JavaScript</button>
    <br>
    <button onclick="webkit()">webkit RegisterExtension</button>
</p>
<p>
    <a href="https://gitee.com/energye/assets/releases/download/cli/energy-windows-64.zip">download:
        energy-windows-64.zip</a>
    <a href="http://chrome.360.cn/html5_labs/demos/dnd/">drag-file: to drag-file url</a>
</p>
<p>

</p>
<div id="msg"></div>
</body>
</html>